using System;

namespace DecisionMaking.Domain.Reports
{
    /// <summary>
    /// Represent a basic report entry 
    /// </summary>
    public abstract class ReportEntry
    {
        public ReportEntry(double pctOfCueValuesKnown, double avgCorrectInferences)
        {
            PctOfCueValuesKnown = (int)(pctOfCueValuesKnown * 100);
            AvgCorrectInferences = avgCorrectInferences;
        }

        public int PctOfCueValuesKnown { get; set; }

        public double AvgCorrectInferences { get; set; }
    }

    /// <summary>
    /// Represents an entry of the Competition Result report (table 2 in Gigerenzer)
    /// </summary>
    public class CompetitionResultReportEntry : ReportEntry
    {
        public CompetitionResultReportEntry(string algorithm, double pctOfCueValuesKnown, double avgCorrectInferences) 
            : base(pctOfCueValuesKnown, avgCorrectInferences)
        {
            Algorithm = algorithm;
        }

        public string Algorithm { get; set; }
    }

    /// <summary>
    /// Represents an entry in a report depicting the performance of a specific Algorithm
    /// </summary>
    public class AlgorithmPerformanceReportEntry : ReportEntry
    {
        public AlgorithmPerformanceReportEntry(string algorithm, int numOfObjectsRecognized, double avgCorrectInferences)
            : base(0, avgCorrectInferences)
        {
            NumOfObjectsRecognized = numOfObjectsRecognized;
            Algorithm = algorithm;
        }

        public AlgorithmPerformanceReportEntry(int numOfObjectsRecognized, double pctOfCueValuesKnown, double avgCorrectInferences)
            : base(pctOfCueValuesKnown, avgCorrectInferences)
        {
            NumOfObjectsRecognized = numOfObjectsRecognized;
        }

        public string Algorithm { get; set; }
        public int NumOfObjectsRecognized { get; set; }
    }

}